package com.financing.wap.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.dao.IFpFundInfoDao;
import com.financing.wap.dto.FpFundInfoDTO;
import com.financing.wap.dto.ProductDTO;
import com.financing.wap.util.SqlName;

/**
 * @Description:实现类
 * @author caojiayao
 * @version 1.0
 * @created 
 */
@Repository("fpFundInfo")
public class FpFundInfoDaoImpl extends BaseDaoImpl implements IFpFundInfoDao {
	
	@Override
	public FpFundInfoDTO getFpFundInfo(Integer id) {
		return (FpFundInfoDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.fpFundInfo,id);
	}
	
	
	@Override
	public Integer insertFpFundInfo(FpFundInfoDTO dto) {
		return (Integer) this.getSqlMapClientTemplate().insert(SqlName.insertFpFundInfo,dto);
	}

	
	@Override
	public Integer updateFpFundInfo(FpFundInfoDTO dto) {
		return (Integer) this.getSqlMapClientTemplate().update(SqlName.updateFpFundInfo, dto);
	}
	
	@Override
	public Integer delFpFundInfo(Integer id) {
		return (Integer) this.getSqlMapClientTemplate().delete(SqlName.delFpFundInfo, id);
	}
	
	@Override
	public List<FpFundInfoDTO> listFpFundInfo(FpFundInfoDTO dto) {
		return (List<FpFundInfoDTO>)this.getSqlMapClientTemplate().queryForList(SqlName.listFpFundInfo, dto);
	}
	
	
	public Integer countFpFundInfo(FpFundInfoDTO dto){
		return (Integer)this.getSqlMapClientTemplate().queryForObject(SqlName.countFpFundInfo, dto);
	}
	
	
	public List<FpFundInfoDTO> listFpFundInfoByCompanyId(String CompanyId){
		return (List<FpFundInfoDTO>)this.getSqlMapClientTemplate().queryForList(SqlName.listFpFundInfoByCompanyId, CompanyId);
	}
	
	public List<FpFundInfoDTO> listFpFundInfoByManagerId(String ManagerId){
		return (List<FpFundInfoDTO>)this.getSqlMapClientTemplate().queryForList(SqlName.listFpFundInfoByManagerId, ManagerId);
	}
	
	@Override
	public Class<FpFundInfoDTO> getEntityClass() {
		return FpFundInfoDTO.class;
	}


	@Override
	public FpFundInfoDTO countFpFundInfoByzt() {
		return (FpFundInfoDTO) this.getSqlMapClientTemplate().queryForObject("fpFundInfo.queryFundCount");
	}


	@Override
	public String fpFundInfoLSJZ(FpFundInfoDTO dto) {
		return (String) this.getSqlMapClientTemplate().queryForObject("fpFundInfo.fpFundInfoLSJZ",dto);
	}


	@Override
	public List<ProductDTO> listFpFundInfoByType() {
		return this.sqlMapClientTemplate.queryForList(com.financing.wap.common.SqlName.queryProductBySimu);
	}
	
}
